/* Firefox userChrome.css tweaks ********************************************************/
/* Github: https://github.com/aris-t2/customcssforfx ************************************/
/****************************************************************************************/


@import "tabs_below_navigation_toolbar_fx128-132.css";

:root {
  --appbutton_in_titlebar: 0px;
}

#main-window:is([tabsintitlebar],[customtitlebar]) #toolbar-menubar[autohide][inactive] ~ #nav-bar #nav-bar-customization-target {
  padding-inline-start: var(--appbutton_in_titlebar) !important;
}

:root:not([lwtheme]):is([tabsintitlebar],[customtitlebar]) #nav-bar,
#main-window:is([tabsintitlebar],[customtitlebar]) #nav-bar {
  margin-inline-end: 145px !important;
  appearance: none !important;
  background: transparent !important;
  border-top: unset !important;
}

#main-window:is([tabsintitlebar],[customtitlebar])[sizemode="normal"] #navigator-toolbox #nav-bar {
  border-left: 0px !important;
  border-right: 0px !important;
}

#main-window:is([tabsintitlebar],[customtitlebar]) #titlebar:has(#toolbar-menubar) {
  margin-bottom: 26px !important;
}
#main-window:is([tabsintitlebar],[customtitlebar]) #titlebar:has(#toolbar-menubar[autohide][inactive]) {
  margin-bottom: 0px !important;
}

#main-window:is([tabsintitlebar],[customtitlebar]) #toolbar-menubar .titlebar-buttonbox-container {
  display: none !important;
}

#main-window:is([tabsintitlebar],[customtitlebar]) #nav-bar,
#main-window:is([tabsintitlebar],[customtitlebar])[sizemode="maximized"] #nav-bar {
  margin-top: -20px !important;
  z-index: 1000 !important;
}

@media (-moz-platform: windows) {
	#main-window:is([tabsintitlebar],[customtitlebar]) #nav-bar,
	#main-window:is([tabsintitlebar],[customtitlebar])[sizemode="maximized"] #nav-bar {
	  margin-top: -24px !important;
	}
}

/* move caption buttons to windows top right position */
#main-window:is([tabsintitlebar],[customtitlebar]):not([inDOMFullscreen="true"]) #toolbar-menubar ~ #TabsToolbar .titlebar-buttonbox-container {
  position: fixed !important;
  right: 0 !important;
  visibility: visible !important;
  display: block !important;
}

/* caption button position in maximized mode after moving to the top */
#main-window:is([tabsintitlebar],[customtitlebar]):not([inDOMFullscreen="true"]) #toolbar-menubar ~ #TabsToolbar .titlebar-buttonbox-container,
#main-window:is([tabsintitlebar],[customtitlebar])[sizemode="maximized"]:not([inDOMFullscreen="true"]) #TabsToolbar .titlebar-buttonbox-container {
  top: -14px !important;
}


/* Windows */
@media (-moz-platform: windows) {
	#main-window:is([tabsintitlebar],[customtitlebar]):not([inDOMFullscreen="true"]) #toolbar-menubar ~ #TabsToolbar .titlebar-buttonbox-container	{
	  top: 1px !important;
	}
	#main-window:is([tabsintitlebar],[customtitlebar])[sizemode="maximized"]:not([inDOMFullscreen="true"]) #toolbar-menubar ~ #TabsToolbar .titlebar-buttonbox-container {
	  top: 0px !important;
	}
}

/* tweaks for fullscreen mode */
#main-window:is([tabsintitlebar],[customtitlebar])[sizemode="fullscreen"] #toolbar-menubar ~ #TabsToolbar .titlebar-buttonbox-container,
#main-window:is([tabsintitlebar],[customtitlebar])[sizemode="fullscreen"] #navigator-toolbox #PanelUI-button,
#main-window #TabsToolbar #window-controls {
  display: none !important;
}

@media all and (-moz-windows-classic) {
  :root:not([lwtheme]):is([tabsintitlebar],[customtitlebar]) #nav-bar,
  #main-window:is([tabsintitlebar],[customtitlebar]) #nav-bar {
	margin-inline-end: 0px !important;
  }
}

#main-window :is(#TabsToolbar,#nav-bar,#PersonalToolbar,#toolbar-menubar,.browser-toolbar) {
  appearance: none !important;
  background: transparent !important;
  border-top: unset !important;
}

